<body>
    <form name="formulario" id="formulario" action="" method="post"> 
        <?php if (isset($cli_idclientes)) { ?> 
            <input type="hidden" name="cli_idclientes" value="<?php echo $cli_idclientes; ?>">  
        <?php } ?> 
        <div class="row">
            <div class="large-8 columns" style="left: 181px;">
                <h1>
                    <small>Cadastro de Clientes</small>
                </h1>
            </div>                
        </div>
        <div class="row">
            <div class="small-8 columns" style="left: 181px">
                <label>cli_razaoSocial
                    <input type="text" name="cli_razaoSocial" id="cli_razaoSocial" value="<?php echo isset($clientes->cli_razaoSocial) ? $clientes->cli_razaoSocial : ''; ?>"  placeholder="cli_razaoSocial" />
                </label>
            </div>                
        </div>
        <div class="row">
            <div class="small-8 columns" style="left: 181px">
                <label>cli_cnpj
                    <input type="text" name="cli_cnpj" id="cli_cnpj" value="<?php echo isset($clientes->cli_cnpj) ? $clientes->cli_cnpj : ''; ?>"  placeholder="cli_cnpj" />
                </label>
            </div>                
        </div>
        <div class="row">
            <div class="small-8 columns" style="left: 181px">
                <label>cli_nomeFantasia
                    <input type="text" name="cli_nomeFantasia" id="cli_nomeFantasia" value="<?php echo isset($clientes->cli_nomeFantasia) ? $clientes->cli_nomeFantasia : ''; ?>"  placeholder="cli_nomeFantasia" />
                </label>
            </div>                
        </div>
        <div class="row">
            <div class="small-8 columns" style="left: 181px">
                <label>cli_endereco
                    <input type="text" name="cli_endereco" id="cli_endereco" value="<?php echo isset($clientes->cli_endereco) ? $clientes->cli_endereco : ''; ?>"  placeholder="cli_endereco" />
                </label>
            </div>                
        </div>
        <div class="row">
            <div class="small-4 columns" style="left: 181px">
                <label>cli_bairro
                    <input type="text" name="cli_bairro" id="cli_bairro" value="<?php echo isset($clientes->cli_bairro) ? $clientes->cli_bairro : ''; ?>"  placeholder="cli_bairro" />
                </label>
            </div>                
        </div>
        <div class="row">
            <div class="small-4 columns" style="left: 181px">
                <label>cli_cidade
                    <input type="text" name="cli_cidade" id="cli_cidade" value="<?php echo isset($clientes->cli_cidade) ? $clientes->cli_cidade : ''; ?>"  placeholder="cli_cidade" />
                </label>
            </div>                
        </div>
        <div class="row">
            <div class="small-8 columns" style="left: 181px">
                <label>cli_uf
                    <input type="text" name="cli_uf" id="cli_uf" value="<?php echo isset($clientes->cli_uf) ? $clientes->cli_uf : ''; ?>"  placeholder="cli_uf" />
                </label>
            </div>                
        </div>
        <div class="row">
            <div class="small-8 columns" style="left: 181px">
                <label>cli_cep
                    <input type="text" name="cli_cep" id="cli_cep" value="<?php echo isset($clientes->cli_cep) ? $clientes->cli_cep : ''; ?>"  placeholder="cli_cep" />
                </label>
            </div>                
        </div>
        <div class="row">
            <div class="small-8 columns" style="left: 181px">
                <label>cli_telefone
                    <input type="text" name="cli_telefone" id="cli_telefone" value="<?php echo isset($clientes->cli_telefone) ? $clientes->cli_telefone : ''; ?>"  placeholder="cli_telefone" />
                </label>
            </div>                
        </div>
        <div class="row">
            <div class="small-8 columns" style="left: 181px">
                <label>cli_responsavelLegal
                    <input type="text" name="cli_responsavelLegal" id="cli_responsavelLegal" value="<?php echo isset($clientes->cli_responsavelLegal) ? $clientes->cli_responsavelLegal : ''; ?>"  placeholder="cli_responsavelLegal" />
                </label>
            </div>                
        </div>
        <div class="row">
            <div class="small-8 columns" style="left: 181px">
                <label>cli_email
                    <input type="text" name="cli_email" id="cli_email" value="<?php echo isset($clientes->cli_email) ? $clientes->cli_email : ''; ?>"  placeholder="cli_email" />
                </label>
            </div>                
        </div>
        <div class="row"> 
            <div style="width: 667px; margin-top: 20px; margin-left: 195px;"> 
                <input type="button" class="button big success" value="Cadastrar" onclick="enviar('I')"/> 
                <?php if (isset($clientes)) { ?> 
                    <input type="button" class="button small alert" value="Excluir" onclick="enviar('E')"/> 
                <?php } ?> 
            </div> 
        </div> 
    </form> 
</body> 

<script>
    function enviar(acao) {
        if (acao == 'I') {
            document.formulario.action = "<?php echo base_url('index.php/clientes/salvar/') ?>";
        }
        if (acao == 'E') {
            document.formulario.action = "<?php echo base_url('index.php/clientes/excluir/') ?>";
        }
        document.formulario.submit();
    }
</script>
<script>
    $(document).ready(function() {
        $(document).foundation();
    });
</script>
